import requestProxy from '@/utils/request';

const { request } = requestProxy;
// 获取链接列表
export function getPublishList(params, cancelToken) {
  return request({
    url: '/admin/publish/list',
    method: 'get',
    params,
    cancelToken
  });
}
// 获取报告列表
export function getReportList(params) {
  return request({
    url: '/admin/publish/report/list',
    method: 'get',
    params
  });
}

export function getPublishTab(params) {
  return request({
    url: '/admin/publish/tab',
    method: 'get',
    params
  });
}

export function putPublishStatus(data) {
  return request({
    url: 'admin/publish/update/status',
    method: 'put',
    data
  });
}
export function putPublishStatusValid(data) {
  return request({
    url: 'admin/publish/valid/join',
    method: 'put',
    data
  });
}

export function getPublishDetailList(params) {
  return request({
    url: 'admin/publish/report/detail/list',
    method: 'get',
    params
  });
}
// 修改报告详情
export function editReportDetail(id, data) {
  return request({
    url: `admin/publish/report/edit/${id}`,
    method: 'put',
    data
  });
}
// 获取报告详情
export function getReportDetail(id, params) {
  return request({
    url: `admin/publish/report/detail/${id}`,
    method: 'get',
    params
  });
}
// 新增链接
export function addLink(data) {
  return request({
    url: 'admin/publish/add',
    method: 'post',
    data
  });
}
// 删除链接
export function deleteLink(params) {
  return request({
    url: 'admin/publish/delete',
    method: 'delete',
    params
  });
}

// 检查链接是否可用
export function checkLink(params) {
  return request({
    url: '/admin/publish/check',
    method: 'get',
    params
  });
}

// 图片重新采集
export function imageRePick(data) {
  return request({
    url: '/admin/publish/image/pick',
    method: 'put',
    data
  });
}

// 批量替换采集
export function batchReplacePick(data) {
  return request({
    url: '/admin/publish/image/replacePick',
    method: 'put',
    data
  });
}

// 删除图片
export function delImage(data) {
  return request({
    url: '/admin/publish/image/delete',
    method: 'delete',
    data
  });
}
// 获取图片列表
export function getImageList(params) {
  return request({
    url: '/admin/publish/image/list',
    method: 'get',
    params
  });
}
// 发布管理-校验链接是否重复

export function checkSameLink(params) {
  return request({
    url: '/admin/publish/checkSameLink',
    method: 'get',
    params
  });
}
// 发布管理-（待处理）统计数据
export function getStatistics(params) {
  return request({
    url: '/admin/publish/statistics',
    method: 'get',
    params
  });
}
